package com.neusoft.myutils;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class MyUtil {
	/**
	 * log4j日志对象
	 */
	public static Log logRootLogger = LogFactory.getLog("rootLogger");
	
	/**
	 * 通过泛型和反射机制获取实例对象
	 * @param clazz
	 * 			class文件
	 * @return 实例对象
	 */
	public static <T> T getInstance(Class<T> clazz) {
		T tClazz = null;
		try {
			tClazz = clazz.newInstance();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return tClazz;
	}
}
